﻿@model ShipmentDetailsModel
@using Nop.Web.Models.Order;

@if (Model.ShipmentStatusEvents.Count > 0)
{
    <div class="shipment-status-events">
        <strong>@T("Order.ShipmentStatusEvents")</strong>
        <div class="shipment-status-events-box">
            <table class="data-table">
                <thead>
                    <tr class="window-title">
                        <th class="a-center">
                            @T("Order.ShipmentStatusEvents.Date")
                        </th>

                        @if (Model.ShowShipmentTime)
                        {
                            <th class="a-center">
                                @T("Order.ShipmentStatusEvents.Time")
                            </th>
                        }

                        @if (Model.ShowShipmentLocation)
                        {
                            <th class="a-center">
                                @T("Order.ShipmentStatusEvents.Location")
                            </th>
                        }
                        @if (Model.ShowShipmentCountry)
                        {
                            <th class="a-center">
                                @T("Order.ShipmentStatusEvents.Country")
                            </th>
                        }
                        <th class="a-center">
                            @T("Order.ShipmentStatusEvents.Event")
                        </th>
                    </tr>
                </thead>

                <tbody>
                    @{
                        var eventCount = 0;
                        foreach (var item in Model.ShipmentStatusEvents)
                        {
                            eventCount++;
                                <tr class="@(eventCount % 2 == 0 ? "even" : "odd")">
                                    <td class="a-left">
                                        @item.Date
                                    </td>
                                    @if (Model.ShowShipmentTime)
                                    {
                                        <td class="a-left">
                                            @item.Time
                                        </td>
                                    }
                                    @if (Model.ShowShipmentLocation)
                                    {
                                        <td class="a-left">
                                            @item.Location
                                        </td>
                                    }
                                    @if (Model.ShowShipmentCountry)
                                    {
                                        <td class="a-left">
                                            @item.Country
                                        </td>
                                    }
                                    <td class="a-left">
                                        @item.EventName
                                    </td>
                                </tr>
                        }
                    }
                </tbody>

            </table>
        </div>
    </div>
}